home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / misc1 / dattim.zip / DATETIME.BAS < prev    next >
BASIC Source File  |  1991-11-03  |  16KB  |  377 lines

  1. '============================================================================'
  2. '                                                                            '
  3. ' Visual Basic global constant file.  This file can be loaded into the       '
  4. ' global module.                                                             '
  5. '                                                                            '
  6. ' Some constants are commented out because they have duplicates (for         '
  7. ' example, NONE appears in several places).                                  '
  8. '                                                                            '
  9. '============================================================================'
  10.  
  11. '========='
  12. '         '
  13. ' General '
  14. '         '
  15. '========='
  16.  
  17. ' Booleans
  18. Global Const TRUE = -1
  19. Global Const FALSE = 0
  20.  
  21. '=================='
  22. '                  '
  23. ' Event parameters '
  24. '                  '
  25. '=================='
  26.  
  27. ' Button and Shift (KeyDown, KeyUp, MouseDown, MouseMove, MouseUp)
  28. Global Const SHIFT_MASK = 1
  29. Global Const CTRL_MASK = 2
  30. Global Const ALT_MASK = 4
  31. Global Const LEFT_BUTTON = 1
  32. Global Const RIGHT_BUTTON = 2
  33. Global Const MIDDLE_BUTTON = 4
  34.  
  35. ' ErrNum (LinkError)
  36. Global Const WRONG_FORMAT = 1
  37. Global Const REQUEST_WITHOUT_INIT = 2
  38. Global Const DDE_WITHOUT_INIT = 3
  39. Global Const ADVISE_WITHOUT_INIT = 4
  40. Global Const POKE_WITHOUT_INIT = 5
  41. Global Const DDE_SERVER_CLOSED = 6
  42. Global Const TOO_MANY_LINKS = 7
  43. Global Const STRING_TOO_LONG = 8
  44. Global Const INVALID_CONTROL_ARRAY_REFERENCE = 9
  45. Global Const UNEXPECTED_DDE = 10
  46. Global Const OUT_OF_MEMORY = 11
  47. Global Const SERVER_ATTEMPTED_CLIENT_OPERATION = 12
  48.  
  49. ' KeyCode (KeyDown, KeyUp)
  50. Global Const KEY_LBUTTON = &H1
  51. Global Const KEY_RBUTTON = &H2
  52. Global Const KEY_CANCEL = &H3
  53. Global Const KEY_MBUTTON = &H4         ' NOT contiguous with L & RBUTTON
  54. Global Const KEY_BACK = &H8
  55. Global Const KEY_TAB = &H9
  56. Global Const KEY_CLEAR = &HC
  57. Global Const KEY_RETURN = &HD
  58. Global Const KEY_SHIFT = &H10
  59. Global Const KEY_CONTROL = &H11
  60. Global Const KEY_MENU = &H12
  61. Global Const KEY_PAUSE = &H13
  62. Global Const KEY_CAPITAL = &H14
  63. Global Const KEY_ESCAPE = &H1B
  64. Global Const KEY_SPACE = &H20
  65. Global Const KEY_PRIOR = &H21
  66. Global Const KEY_NEXT = &H22
  67. Global Const KEY_END = &H23
  68. Global Const KEY_HOME = &H24
  69. Global Const KEY_LEFT = &H25
  70. Global Const KEY_UP = &H26
  71. Global Const KEY_RIGHT = &H27
  72. Global Const KEY_DOWN = &H28
  73. Global Const KEY_SELECT = &H29
  74. Global Const KEY_PRINT = &H2A
  75. Global Const KEY_EXECUTE = &H2B
  76. Global Const KEY_SNAPSHOT = &H2C
  77. Global Const KEY_INSERT = &H2D
  78. Global Const KEY_DELETE = &H2E
  79. Global Const KEY_HELP = &H2F
  80.  
  81. ' KEY_A thru KEY_Z are the same as their ASCII equivalents: 'A' thru 'Z'
  82. ' KEY_0 thru KEY_9 are the same as their ASCII equivalents: '0' thru '9'
  83.  
  84. Global Const KEY_NUMPAD0 = &H60
  85. Global Const KEY_NUMPAD1 = &H61
  86. Global Const KEY_NUMPAD2 = &H62
  87. Global Const KEY_NUMPAD3 = &H63
  88. Global Const KEY_NUMPAD4 = &H64
  89. Global Const KEY_NUMPAD5 = &H65
  90. Global Const KEY_NUMPAD6 = &H66
  91. Global Const KEY_NUMPAD7 = &H67
  92. Global Const KEY_NUMPAD8 = &H68
  93. Global Const KEY_NUMPAD9 = &H69
  94. Global Const KEY_MULTIPLY = &H6A
  95. Global Const KEY_ADD = &H6B
  96. Global Const KEY_SEPARATOR = &H6C
  97. Global Const KEY_SUBTRACT = &H6D
  98. Global Const KEY_DECIMAL = &H6E
  99. Global Const KEY_DIVIDE = &H6F
  100. Global Const KEY_F1 = &H70
  101. Global Const KEY_F2 = &H71
  102. Global Const KEY_F3 = &H72
  103. Global Const KEY_F4 = &H73
  104. Global Const KEY_F5 = &H74
  105. Global Const KEY_F6 = &H75
  106. Global Const KEY_F7 = &H76
  107. Global Const KEY_F8 = &H77
  108. Global Const KEY_F9 = &H78
  109. Global Const KEY_F10 = &H79
  110. Global Const KEY_F11 = &H7A
  111. Global Const KEY_F12 = &H7B
  112. Global Const KEY_F13 = &H7C
  113. Global Const KEY_F14 = &H7D
  114. Global Const KEY_F15 = &H7E
  115. Global Const KEY_F16 = &H7F
  116. Global Const KEY_NUMLOCK = &H90
  117.  
  118. ' State (DragOver)
  119. Global Const ENTER = 0
  120. Global Const LEAVE = 1
  121. Global Const OVER = 2
  122.  
  123. '====================='
  124. '                     '
  125. ' Function parameters '
  126. '                     '
  127. '====================='
  128.  
  129. ' MsgBox parameters
  130. Global Const MB_OK = 0                 ' OK button only
  131. Global Const MB_OKCANCEL = 1           ' OK and Cancel buttons
  132. Global Const MB_ABORTRETRYIGNORE = 2   ' Abort, Retry, and Ignore buttons
  133. Global Const MB_YESNOCANCEL = 3        ' Yes, No, and Cancel buttons
  134. Global Const MB_YESNO = 4              ' Yes and No buttons
  135. Global Const MB_RETRYCANCEL = 5        ' Retry and Cancel buttons
  136.  
  137. Global Const MB_ICONSTOP = 16          ' Critical message
  138. Global Const MB_ICONQUESTION = 32      ' Warning query
  139. Global Const MB_ICONEXCLAMATION = 48   ' Warning message
  140. Global Const MB_ICONINFORMATION = 64   ' Information message
  141.  
  142. Global Const MB_DEFBUTTON1 = 0         ' First button is default
  143. Global Const MB_DEFBUTTON2 = 256       ' Second button is default
  144. Global Const MB_DEFBUTTON3 = 512       ' Third button is default
  145.  
  146. ' MsgBox return values
  147. Global Const IDOK = 1                  ' OK button pressed
  148. Global Const IDCANCEL = 2              ' Cancel button pressed
  149. Global Const IDABORT = 3               ' Abort button pressed
  150. Global Const IDRETRY = 4               ' Retry button pressed
  151. Global Const IDIGNORE = 5              ' Ignore button pressed
  152. Global Const IDYES = 6                 ' Yes button pressed
  153. Global Const IDNO = 7                  ' No button pressed
  154.  
  155. ' Shell window parameters
  156. Global Const SH_NORMAL_FOCUS = 1       ' Normales Fenster mit Fokus
  157. Global Const SH_MINIMIZED_FOCUS = 2    ' Auf Symbolgr÷▀e verkleinert mit Fokus
  158. Global Const SH_MAXIMIZED_FOCUS = 3    ' Vollbild mit Fokus
  159. Global Const SH_NORMAL_NOFOCUS = 4     ' Normales Fenster ohne Fokus
  160. Global Const SH_MINIMIZED_NOFOCUS = 7  ' Auf Symbolgr÷▀e verkleinert ohne Fokus
  161.  
  162. '==================='
  163. '                   '
  164. ' Method parameters '
  165. '                   '
  166. '==================='
  167.  
  168. ' Drag (controls)
  169. Global Const CANCEL = 0
  170. Global Const BEGIN_DRAG = 1
  171. Global Const END_DRAG = 2
  172.  
  173. ' GetData, GetFormat, SetData (Clipboard)
  174. Global Const CF_LINK = &HBF00
  175. Global Const CF_TEXT = 1
  176. Global Const CF_BITMAP = 2
  177. Global Const CF_METAFILE = 3
  178. Global Const CF_DIB = 8
  179.  
  180. ' Show (form)
  181. Global Const MODAL = 1
  182. Global Const MODELESS = 0
  183.  
  184. '================='
  185. '                 '
  186. ' Property values '
  187. '                 '
  188. '================='
  189.  
  190. ' Alignment (label)
  191. Global Const LEFT_JUSTIFY = 0          ' 0 - Left Justify
  192. Global Const RIGHT_JUSTIFY = 1         ' 1 - Right Justify
  193. Global Const CENTER = 2                ' 2 - Center
  194.  
  195. ' BackColor, ForeColor, FillColor (standard RGB colors: form, controls)
  196. Global Const BLACK = &H0&
  197. Global Const RED = &HFF&
  198. Global Const GREEN = &HFF00&
  199. Global Const YELLOW = &HFFFF&
  200. Global Const BLUE = &HFF0000
  201. Global Const MAGENTA = &HFF00FF
  202. Global Const CYAN = &HFFFF00
  203. Global Const WHITE = &HFFFFFF
  204.  
  205. ' BackColor, ForeColor, FillColor (system colors: form, controls)
  206. Global Const SCROLL_BARS = &H80000000           ' Scroll-bars gray area.
  207. Global Const DESKTOP = &H80000001               ' Desktop.
  208. Global Const ACTIVE_TITLE_BAR = &H80000002      ' Active window caption.
  209. Global Const INACTIVE_TITLE_BAR = &H80000003    ' Inactive window caption.
  210. Global Const MENU_BAR = &H80000004              ' Menu background.
  211. Global Const WINDOW_BACKGROUND = &H80000005     ' Window background.
  212. Global Const WINDOW_FRAME = &H80000006          ' Window frame.
  213. Global Const MENU_TEXT = &H80000007             ' Text in menus.
  214. Global Const WINDOW_TEXT = &H80000008           ' Text in windows.
  215. Global Const TITLE_BAR_TEXT = &H80000009        ' Text in caption, size box, scroll-bar arrow box..
  216. Global Const ACTIVE_BORDER = &H8000000A         ' Active window border.
  217. Global Const INACTIVE_BORDER = &H8000000B       ' Inactive window border.
  218. Global Const APPLICATION_WORKSPACE = &H8000000C ' Background color of multiple document interface (MDI) applications.
  219. Global Const HIGHLIGHT = &H8000000D             ' Items selected item in a control.
  220. Global Const HIGHLIGHT_TEXT = &H8000000E        ' Text of item selected in a control.
  221. Global Const BUTTON_FACE = &H8000000F           ' Face shading on command buttons.
  222. Global Const BUTTON_SHADOW = &H80000010         ' Edge shading on command buttons.
  223. Global Const GRAY_TEXT = &H80000011             ' Grayed (disabled) text.  This color is set to 0 if the current display driver does not support a solid gray color.
  224. Global Const BUTTON_TEXT = &H80000012           ' Text on push buttons.
  225.  
  226. ' BorderStyle (form, label, picture box, text box)
  227. Global Const NONE = 0                  ' 0 - None
  228. Global Const FIXED_SINGLE = 1          ' 1 - Fixed Single
  229. Global Const SIZABLE = 2               ' 2 - Sizable (Forms only)
  230. Global Const FIXED_DOUBLE = 3          ' 3 - Fixed Double (Forms only)
  231.  
  232. ' DragMode (controls)
  233. Global Const MANUAL = 0                ' 0 - Manual
  234. Global Const AUTOMATIC = 1             ' 1 - Automatic
  235.  
  236. ' DrawMode (form, picture box, Printer)
  237. Global Const BLACKNESS = 1             ' 1 - Blackness
  238. Global Const NOT_MERGE_PEN = 2         ' 2 - Not Merge Pen
  239. Global Const MASK_NOT_PEN = 3          ' 3 - Mask Not Pen
  240. Global Const NOT_COPY_PEN = 4          ' 4 - Not Copy Pen
  241. Global Const MASK_PEN_NOT = 5          ' 5 - Mask Pen Not
  242. Global Const INVERT = 6                ' 6 - Invert
  243. Global Const XOR_PEN = 7               ' 7 - Xor Pen
  244. Global Const NOT_MASK_PEN = 8          ' 8 - Not Mask Pen
  245. Global Const MASK_PEN = 9              ' 9 - Mask Pen
  246. Global Const NOT_XOR_PEN = 10          ' 10 - Not Xor Pen
  247. Global Const NOP = 11                  ' 11 - Nop
  248. Global Const MERGE_NOT_PEN = 12        ' 12 - Merge Not Pen
  249. Global Const COPY_PEN = 13             ' 13 - Copy Pen
  250. Global Const MERGE_PEN_NOT = 14        ' 14 - Merge Pen Not
  251. Global Const MERGE_PEN = 15            ' 15 - Merge Pen
  252. Global Const WHITENESS = 16            ' 16 - Whiteness
  253.  
  254. ' DrawStyle (form, picture box, Printer)
  255. Global Const SOLID = 0                 ' 0 - Solid
  256. Global Const DASH = 1                  ' 1 - Dash
  257. Global Const DOT = 2                   ' 2 - Dot
  258. Global Const DASH_DOT = 3              ' 3 - Dash-Dot
  259. Global Const DASH_DOT_DOT = 4          ' 4 - Dash-Dot-Dot
  260. Global Const INVISIBLE = 5             ' 5 - Invisible
  261. Global Const INSIDE_SOLID = 6          ' 6 - Inside Solid
  262.  
  263. ' FillStyle (form, picture box, Printer)
  264. 'Global Const SOLID = 0                 ' 0 - Solid
  265. Global Const TRANSPARENT = 1           ' 1 - Transparent
  266. Global Const HORIZONTAL_LINE = 2       ' 2 - Horizontal Line
  267. Global Const VERTICAL_LINE = 3         ' 3 - Vertical Line
  268. Global Const UPWARD_DIAGONAL = 4       ' 4 - Upward Diagonal
  269. Global Const DOWNWARD_DIAGONAL = 5     ' 5 - Downward Diagonal
  270. Global Const CROSS = 6                 ' 6 - Cross
  271. Global Const DIAGONAL_CROSS = 7        ' 7 - Diagonal Cross
  272.  
  273. ' LinkMode (controls)
  274. 'Global Const NONE = 0                  ' 0 - None
  275. Global Const HOT = 1                   ' 1 - Hot
  276. Global Const COLD = 2                  ' 2 - Cold
  277.  
  278. ' LinkMode (form)
  279. 'Global Const NONE = 0                  ' 0 - None
  280. Global Const SERVER = 1                ' 1 - Server
  281.  
  282. ' MousePointer (form, controls)
  283. Global Const DEFAULT = 0               ' 0 - Default
  284. Global Const ARROW = 1                 ' 1 - Arrow
  285. Global Const CROSSHAIR = 2             ' 2 - Cross
  286. Global Const IBEAM = 3                 ' 3 - I-Beam
  287. Global Const ICON_POINTER = 4          ' 4 - Icon
  288. Global Const SIZE_POINTER = 5          ' 5 - Size
  289. Global Const SIZE_NE_SW = 6            ' 6 - Size NE SW
  290. Global Const SIZE_N_S = 7              ' 7 - Size N S
  291. Global Const SIZE_NW_SE = 8            ' 8 - Size NW SE
  292. Global Const SIZE_W_E = 9              ' 9 - Size W E
  293. Global Const UP_ARROW = 10             ' 10 - Up Arrow
  294. Global Const HOURGLASS = 11            ' 11 - Hourglass
  295. Global Const NO_DROP = 12              ' 12 - No drop
  296.  
  297. ' ScaleMode (form, picture box, Printer)
  298. Global Const USER = 0                  ' 0 - User
  299. Global Const TWIPS = 1                 ' 1 - Twip
  300. Global Const POINTS = 2                ' 2 - Point
  301. Global Const PIXELS = 3                ' 3 - Pixel
  302. Global Const CHARACTERS = 4            ' 4 - Character
  303. Global Const INCHES = 5                ' 5 - Inch
  304. Global Const MILLIMETERS = 6           ' 6 - Millimeter
  305. Global Const CENTIMETERS = 7           ' 7 - Centimeter
  306.  
  307. ' ScrollBar (text box)
  308. 'Global Const NONE = 0                  ' 0 - None
  309. Global Const HORIZONTAL = 1            ' 1 - Horizontal
  310. Global Const VERTICAL = 2              ' 2 - Vertical
  311. Global Const BOTH = 3                  ' 3 - Both
  312.  
  313. ' Value (check box)
  314. Global Const UNCHECKED = 0             ' 0 - Unchecked
  315. Global Const CHECKED = 1               ' 1 - Checked
  316. Global Const GRAYED = 2                ' 2 - Grayed
  317.  
  318. ' WindowState (form)
  319. Global Const NORMAL = 0                ' 0 - Normal
  320. Global Const MINIMIZED = 1             ' 1 - Minimized
  321. Global Const MAXIMIZED = 2             ' 2 - Maximized
  322.  
  323. '=============================='
  324. '                              '
  325. ' Some Important API Functions '
  326. '                              '
  327. '=============================='
  328.  
  329. ' SetWindowPos Flags:
  330. Global Const SWP_NOSIZE = &H1
  331. Global Const SWP_NOMOVE = &H2
  332. Global Const SWP_NOACTIVATE = &H10
  333. Global Const SWP_SHOWWINDOW = &H40
  334. Declare Sub SetWindowPos Lib "User" (ByVal hWnd%, ByVal hWndInsertAfter%, ByVal X%, ByVal Y%, ByVal cx%, ByVal cy%, ByVal wFlags%)
  335.  
  336. Declare Function GetFocus% Lib "User" ()
  337. Declare Function GetActiveWindow% Lib "User" ()
  338. Declare Function SetFocusAPI% Lib "User" Alias "SetFocus" (ByVal hWnd%)
  339. Declare Function IsWindowVisible% Lib "User" (ByVal hWnd%)
  340. Declare Function GetNextWindow% Lib "User" (ByVal hWnd%, ByVal wFlag%)
  341.  
  342. ' GetWindow Constants
  343. Global Const GW_HWNDFIRST = 0
  344. Global Const GW_HWNDLAST = 1
  345. Global Const GW_HWNDNEXT = 2
  346. Global Const GW_HWNDPREV = 3
  347. Global Const GW_OWNER = 4
  348. Global Const GW_CHILD = 5
  349. Declare Function GetWindow% Lib "User" (ByVal hWnd%, ByVal wCmd%)
  350.  
  351. ' User Profile Routines (provided by the Microsoft Windows Kernel DLL)
  352. Declare Function GetProfileInt% Lib "Kernel" (ByVal lpAppName$, ByVal lpKeyName$, ByVal nDefault%)
  353. Declare Function GetProfileString% Lib "Kernel" (ByVal lpAppName$, ByVal lpKeyName$, ByVal lpDefault$, ByVal lpReturnedString$, ByVal nSize%)
  354. Declare Function WriteProfileString% Lib "Kernel" (ByVal lpApplicationName$, ByVal lpKeyName$, ByVal lpString$)
  355. Declare Function GetPrivateProfileInt% Lib "Kernel" (ByVal lpApplicationName$, ByVal lpKeyName$, ByVal nDefault%, ByVal lpFilename$)
  356. Declare Function GetPrivateProfileString% Lib "Kernel" (ByVal lpApplicationName$, ByVal lpKeyName$, ByVal lpDefault$, ByVal lpReturnedString$, ByVal nSize%, ByVal lpFilename$)
  357. Declare Function WritePrivateProfileString% Lib "Kernel" (ByVal lpApplicationName$, ByVal lpKeyName$, ByVal lpString$, ByVal lpFilename$)
  358. Declare Function GetWindowsDirectory% Lib "Kernel" (ByVal lpBuffer$, ByVal nSize%)
  359. Declare Function GetSystemDirectory% Lib "Kernel" (ByVal lpBuffer$, ByVal nSize%)
  360.  
  361. ' Functions to get own filename
  362. Global Const GCW_HMODULE = -16
  363. Declare Function GetClassWord% Lib "User" (ByVal hModule%, ByVal nIndex%)
  364. Declare Function GetModuleFileName% Lib "Kernel" (ByVal hModule%, ByVal lpFilename$, ByVal nSize%)
  365.  
  366. ' General
  367. Global NL$, TB$
  368.  
  369. '==============================='
  370. '                               '
  371. ' Program specific declarations '
  372. '                               '
  373. '==============================='
  374.  
  375. Global DatTim$
  376.  
  377.